package com.bobo.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * 定时任务执行日志
 *
 * @author LILIBO
 * @since 2023-02-18
 */
@Tag(name = "定时任务执行日志")
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("sys_job_log")
public class SysJobLog implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 执行日志ID
     */
    @Schema(name = "执行日志ID")
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 任务名称
     */
    @Schema(name = "任务名称")
    private String jobName;

    /**
     * 任务分组
     */
    @Schema(name = "任务分组")
    private String jobGroup;

    /**
     * 目标任务
     */
    @Schema(name = "目标任务")
    private String invokeTarget;

    /**
     * 执行结果信息
     */
    @Schema(name = "执行结果信息")
    private String jobMessage;

    /**
     * 执行状态（0:成功;1:失败）
     */
    @Schema(name = "执行状态（0:成功;1:失败）")
    private Integer status;

    /**
     * 执行开始时间
     */
    @Schema(name = "执行开始时间")
    private Date startTime;

    /**
     * 执行停止时间
     */
    @Schema(name = "执行停止时间")
    private Date endTime;

    /**
     * 定时任务日志记录时间
     */
    @Schema(name = "定时任务日志记录时间")
    private String recordTime;

    public SysJobLog(String jobName, String jobGroup, String invokeTarget, String jobMessage, Integer status, Date startTime, Date endTime, String recordTime) {
        this.jobName = jobName;
        this.jobGroup = jobGroup;
        this.invokeTarget = invokeTarget;
        this.jobMessage = jobMessage;
        this.status = status;
        this.startTime = startTime;
        this.endTime = endTime;
        this.recordTime = recordTime;
    }

}
